package com.hb.unic.core.context.processor;

import com.hb.unic.core.context.handler.IBeforeShutdownHandler;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextClosedEvent;

import com.hb.unic.core.dispatcher.EventUtils;

/**
 * 应用关闭前
 *
 * @since v1.0，2023/8/29 22:14，create by Mr.Huang.
 */
public class BeforeShutdownProcessor implements ApplicationListener<ContextClosedEvent> {

    @Override
    public void onApplicationEvent(ContextClosedEvent event) {
        EventUtils.dispatch(IBeforeShutdownHandler.class);
    }

}
